fix: support SDK 54 BaseMods API and multiple widget-type targets#180
Open
jackrobinsonuk wants to merge 1 commit intoEvanBacon:mainfrom
Open
fix: support SDK 54 BaseMods API and multiple widget-type targets#180jackrobinsonuk wants to merge 1 commit intoEvanBacon:mainfrom
jackrobinsonuk wants to merge 1 commit intoEvanBacon:mainfrom
Conversation
Author
|
Hey @EvanBacon - have you had chance to look at this please? |
|
@EvanBacon Would love to see this! Currently it's impossible to separate widgets/live activities across multiple targets, which is important to avoid hitting the memory limits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two independent bugs that surface together when using this package with Expo SDK 54 and multiple
type: "widget"targets.Bug 1 —
BaseMods.withGeneratedBaseMods/BaseMods.providerremoved in SDK 54BaseMods.withGeneratedBaseModsandBaseMods.providerwere removed from theBaseModsobject in SDK 54's@expo/config-plugins. They are now standalone exports from@expo/config-plugins/build/plugins/createBaseMod. With the old import, prebuild fails immediately withBaseMods.provider is not a function.Bug 2 — Multiple
type: "widget"targets clobber each otherBoth home screen widgets and Live Activities share the
com.apple.widgetkit-extensionextension point identifier.getExtensionTargets()returns all targets of that type. When a project has more than one, the?? targets[0]fallback inapplyXcodeChangessilently picks the first existing target instead of creating a new one — clearing itsbuildConfigurationListreference and then crashing on:Fix
BaseModsimport with direct named imports ofproviderandwithGeneratedBaseModsfrom@expo/config-plugins/build/plugins/createBaseMod?? targets[0]fallback — if no target matches byproductName, let it fall through to the creation path so each uniquely-named target is always created independentlyTesting
Validated locally against a real production app that has exactly the Bug 2 crash scenario — three
type: "widget"targets:habits_widgetcom.fittech.habits_widgethydration_widgetcom.fittech.hydration_widgetlive_activitycom.fittech.app.LiveActivityThe patched build was dropped into the app's
node_modulesandnpx expo prebuild --platform ios --cleanwas run. Prebuild completed successfully with all three widget targets created independently.Test plan
bunx expo-module typecheckpassesbun test(unit tests) passesbun run test:e2e)Closes #144